m =[6, 2, 5, 5, 4, 5, 6, 3, 7, 6]
def count(a):
    if a == 0:
        return 6
    b = 0
    while a > 0:
        digit = a % 10
        b += m[digit]
        a = a // 10
    return b

result = [0] * 24

for n in range(10, 25):
    print(n)
    for i in range(0, 20000):
        for j in range(0, 20000):
            if count(i) + count(j) + count(i+j) == n - 4:
                result[n-1] += 1
print(result)
# 题目中数值较小可以直接穷举出来，先看0-9需要多少根火柴棒，然后输入一个数看需要多少根，然后继续进行，输出结果